import React from 'react'
import { withRouter } from 'react-router-dom'
import {SideBar} from "antd-mobile"

function left(props) {
    let {n,list,changeN}=props
    return (
        <div className='left'>
            <SideBar activeKey={n + ""} onChange={(e) => {changeN(Number(e))}}>
                {list.map(item => (
                    <SideBar.Item
                        key={item.id}
                        title={item.catename}
                    />
                ))}
            </SideBar>
        </div>
    )
}

export default withRouter(left)